// 和文章相关的接口
import { request } from "@/utils";

export function getChannelApi() { 
    return request({
        url: '/channels',
        method: 'GET',
        // data:
    })
}

export function createArticleApi(data) { 
    return request({
        url: 'mp/articles?draft=false',
        method: 'POST',
        data
    })
}

// 获取文章列表接口
export function getArticleListApi(params) { 

    return request({
        url: '/mp/articles',
        method: 'GET',
        params


    })
}

// 删除接口
export function delArticleListApi(id) { 
    return request({
        url: `/mp/articles/${id}`,
        method: 'DELETE',
    })
}

export function getArticleById(id) { 
    return request({
        url: `/mp/articles/${id}`,
        method: 'GET',
    })
}

// 编辑文章
export function changeArticleById(data) { 
    return request({
        url: `/mp/articles/${data.id}?draft=false`,
        method: 'PUT',
        data

    })


}